package day1107.demo04;

/**
 * @author wql
 * @version 1.0
 * @date 2022/11/7 16:22
 */

public class Water {
    private  Water(){

    }
    private static Water water;

    public static Water getInstance(){
        if (water==null){
            synchronized (Water.class){
                if (water==null){
                    water=new Water();
                }
            }
        }
        return water;
    }
    public void haha(){
        System.out.println("这是懒汉式双重校验锁");
    }
}
